//
//  YCApplyCashViewController.m
//  YCVillageDoctor
//
//  Created by zhangxiaoliang on 2017/6/7.
//  Copyright © 2017年 zhangxiaoliang. All rights reserved.
//

#import "YCApplyCashViewController.h"
#import "JX_WebView.h"
@interface YCApplyCashViewController ()
@property(nonatomic,strong)JX_WebView *webView;
@end

@implementation YCApplyCashViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.title = @"申请提现";
    
    self.view.backgroundColor = [UIColor redColor];
    
    //进行配置控制器
    WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
    //实例化对象
    configuration.userContentController = [WKUserContentController new];
    
    WKPreferences *preferences = [WKPreferences new];
    preferences.javaScriptCanOpenWindowsAutomatically = YES;
    configuration.preferences = preferences;
    
    
    self.webView =[[JX_WebView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 64)configuration:configuration];
    [self.view addSubview:_webView];
    
    _webView.backgroundColor = [UIColor clearColor];
    
    NSString * urlString = @"http://wx-heartorg.yk2020.com/weixin/index.php?m=Expert&c=Loverank&a=take";

    [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
    [_webView webViewLoadStart:^(WKWebView *webview,WKNavigation *navigation) {
        [self presentLoadingTips:nil];
    } Finish:^(WKWebView *webview,WKNavigation *navigation) {
        [self dismissTips];
    } Fail:^(WKWebView *webview,WKNavigation *navigation) {
        [self dismissTips];
    }];
    
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(kScreenWidth - 60, kScreenHeight - 130, 54, 54)];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [btn setImage:[UIImage imageNamed:@"矢量智能对象xx"] forState:UIControlStateNormal];
    [self.view addSubview:btn];
}
- (void)btnClick
{
    [self.webView reload];
}
@end
